package com.luisliuyi.demo.optimize.crash;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.View;

public class MainActivity extends AppCompatActivity {
    public static String TAG = "MainActivity";
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
    }

    public void anrTest(View view){
        try {
            Thread.sleep(1000000);
            Log.e(TAG, "anrEnd: ");
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
    }

    public void crashTest(View view){
        String str = null;
        str.length();
    }

    public void startDemoActivity(View view){
        Intent intent = new Intent(this,DemoActivity.class);
        startActivity(intent);
    }


}
